package com.ivision.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.ivision.domain.Student;
import com.ivision.service.StudentService;

//@Component
@Controller
public class StudentController {
	
//	@Autowired
//	private StudentService studentService;
//	
//	@RequestMapping(value="student/{id}",method=RequestMethod.GET)
//	public String getStudentInfo(@PathVariable("id") int studentId, Model model){
//		System.out.println("supplied studentid(id) is : "+studentId);
//		
//		
//		Student student = studentService.getStudentInfoById(studentId);
//		
//		model.addAttribute("studentInfo", student);
//		
//		return "studentInfoPage";
//	}
//	
//	http://localhost/batch8/student/hello
//	method=RequestMethod.GET is by default
	@RequestMapping("/student/hello")//, method=RequestMethod.GET)
	public String sayHiToStudent(Model model){
		String helloMessage = "Hello...World..";
		model.addAttribute("messageKey",helloMessage);
		
		return "hello";
	}
	
}
